package models

import (
	"gameserver/tools/TestRobot/cmd"

	"gitee.com/night-tc/gobige/msgdef"
	"gitee.com/night-tc/gobige/msghandler"
	"gitee.com/night-tc/gobige/sess"
)

type RobotSession struct {
	sess.INetSess

	MsgHander *msghandler.KeyHandlers
}

func (this *RobotSession) Send(msg msgdef.IMsg) {
	if this != nil {
		this.INetSess.Send(msg)
	}
}

func (this *RobotSession) RegMsgProc(cmdtype cmd.CmdTypeEnum, proc interface{}) {
	if cmdtype == "" {
		this.MsgHander.RegMsgProc(proc)
	} else {
		this.MsgHander.RegMsgProcByKey(cmdtype.String(), proc)
	}
}
